import { useState } from "react";
import ReactDOM from "react-dom";

function App() {
    let [name, setName] = useState("xiaohei");
    let [age, setAge] = useState(18);
    return (
        <div className="App">
            <h1>{name}</h1>
            <h1>{age}</h1>
            <button
                onClick={() => {
                    setTimeout(() => {
                        ReactDOM.unstable_batchedUpdates(() => {
                            setName("xiaoming");
                            setAge(20);

                            console.log("111");
                        });
                    }, 1000);
                }}
            >
                点击
            </button>
        </div>
    );
}

export default App;
